using System;

namespace SharpFastCGI
{
	public interface IApplicationFactory
	{
		/// <summary>
		/// Returns a Responder to process a request.
		/// </summary>
		/// <returns>
		/// An IApplication if the Responder role is supported, a null reference otherwise.
		/// </returns>
		/// <remarks>
		/// If the IApplication is thread-safe, it is recommended to return always the same IApplication.
		/// </remarks>
		IApplication GetResponder();
		
		/// <summary>
		/// Returns a Filter to process a request.
		/// </summary>
		/// <returns>
		/// An IApplication if the Filter role is supported, a null reference otherwise.
		/// </returns>
		/// <remarks>
		/// If the IApplication is thread-safe, it is recommended to return always the same IApplication.
		/// </remarks>
		IApplication GetFilter();
		
		/// <summary>
		/// Returns a Authorizer to process a request.
		/// </summary>
		/// <returns>
		/// An IApplication if the Authorizer role is supported, a null reference otherwise.
		/// </returns>
		/// <remarks>
		/// If the IApplication is thread-safe, it is recommended to return always the same IApplication.
		/// </remarks>
		IApplication GetAuthorizer();
	}
}
